package psn.zjk.common;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;

import java.util.LinkedList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author zhangjk
 * @CREATE_TIME 2020/12/17 19:23
 */
public class Test {

    private volatile int x;
    private int y;

    public void add(int z) {
        x=z;
    }

    public void add1(int z) {
        y=z;
    }


    public static void main(String[] args) throws InterruptedException {
        ExecutorService executorService = Executors.newFixedThreadPool(5);
        executorService.execute(() -> {
            LinkedList<Object> objects = new LinkedList<>();

            while (true){
                objects.add(RandomStringUtils.random(RandomUtils.nextInt(100,300)*1024));
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });

    }

}